home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / raytrace / radiance / simplerd.lha / simplerad / FinalFTP / Light / rlog.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-21  |  1.6 KB  |  44 lines

  1. /**********************************************************************/
  2. /* rlog.c                                                             */
  3. /*                                                                    */
  4. /* For storing data in LaTex table form.                              */
  5. /*                                                                    */
  6. /* Copyright (C) 1992, Bernard Kwok                                   */
  7. /* All rights reserved.                                               */
  8. /* Revision 1.0                                                       */
  9. /* May, 1992                                                          */
  10. /**********************************************************************/
  11. #include <stdio.h>
  12. #include <stdlib.h>
  13. #include <string.h>
  14. #include "geo.h"
  15. #include "struct.h"
  16. #include "io.h"
  17. #include "ray.h"
  18. #include "ff.h"
  19.  
  20. extern char *ProgName;
  21.  
  22. FILE *rlogfile;               /* File of data points of convergence */
  23. char *rlogfilename =          /* Filename */
  24.   "                              ";
  25.  
  26. /**********************************************************************/
  27. /* Switch log on / off */
  28. /**********************************************************************/
  29. void LogRlog(logflag,fname,fext)
  30.      int logflag;
  31.      char *fname;
  32.      char *fext;
  33. {
  34.   if (logflag) {
  35.     sprintf(rlogfilename,"%s.%s.tex",fname,fext);   /* RLog log */
  36.     if (!(rlogfile = fopen(rlogfilename, "w"))) {
  37.       fprintf(stderr,"%s: cannot open log file %s\n", ProgName, rlogfilename);
  38.       exit(1);
  39.     } 
  40.     printf("\n\t*** Print run log data to %s ***\n", rlogfilename);
  41.   } else 
  42.     fclose(rlogfile);
  43. }
  44.